<template>
    <div>
        <el-input v-model="name" placeholder="请输入"></el-input>
        <el-button type="primary" @click="updateName(name)">修改</el-button>
    </div>
</template>
<script>
import { mapMutations } from 'vuex'

const options={
    data(){
        return{
            name:''
        }
    },
    methods: {
        // update(){
        //     //sessionStorage.setItem("name",this.name)
        //     this.$store.commit('updateName',this.name)
        // }
        ...mapMutations(['updateName'])
    }
}
export default options
</script>